package com.berchina.service.impl;

import com.berchina.bean.Customer;
import com.berchina.mapper.CustomerMapper;
import com.berchina.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class CustomerServiceImp implements CustomerService {
    @Autowired
    private CustomerMapper customerMapper;
    public int saveCustomer(String phone, String name, String address, Date date, String car) {
        Customer customer = new Customer();
        customer.setName(name);
        customer.setPhone(phone);
        customer.setCar(car);
        customer.setCreatetime(date);
        int i = customerMapper.insertSelective(customer);
        return i;
    }

    public int saveCustomerPhone(Customer customer) {
        return customerMapper.insert(customer);
    }
}
